package topcoder;

public class ShoutterDiv2 {

	public int count(int[] s, int[] t) {
		int c = 0;
		for (int i = 0; i < t.length - 1; i++) {
			for (int j = i + 1; j < t.length; j++) {
				if ( (s[i] >= s[j] && s[i] <= t[j]) || (s[j] >= s[i] && s[j] <= t[i]))
					c++;
			}
		}
		return c;
	}
}
